home *** CD-ROM | disk | FTP | other *** search
/ ftp.cs.arizona.edu / ftp.cs.arizona.edu.tar / ftp.cs.arizona.edu / icon / newsgrp / group00a.txt / 000068_icon-group-sender _Mon Apr 17 07:41:15 2000.msg < prev    next >
Internet Message Format  |  2001-01-03  |  2KB

  1. Return-Path: <icon-group-sender>
  2. Received: (from root@localhost)
  3.     by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id HAA28574
  4.     for icon-group-addresses; Mon, 17 Apr 2000 07:39:46 -0700 (MST)
  5. Message-Id: <200004171439.HAA28574@baskerville.CS.Arizona.EDU>
  6. From: "F.G. van DORP" <F.G.van.Dorp@digimedia.nl>
  7. X-Newsgroups: comp.lang.icon
  8. Subject: Re: Reversible assignment really reversible ?
  9. X-Newsreader: Forte Agent 1.7/32.534
  10. Date: Sat, 15 Apr 2000 17:43:15 GMT
  11. X-Complaints-To: abuse@chello.nl
  12. X-Trace: nlnews00.chello.com 955820595 212.187.67.243 (Sat, 15 Apr 2000 16:43:15 GMT)
  13. To: icon-group@optima.CS.Arizona.EDU
  14. Errors-To: icon-group-errors@optima.CS.Arizona.EDU
  15. Status: RO
  16.  
  17. On 10 Apr 2000 16:06:19 -0400, "Frank J. Lhota"
  18. <NOSPAM.Frank.Lhota@lexma.meitech.com> wrote:
  19.  
  20. >Yes, reversible assignment really is implemented. The problem is due to two
  21. >flaws in your test.
  22. >
  23. >First of all, when a local variable is used in a co-expression, 
  24. >...
  25. Important lesson learnt: don't mess around with co-expressions, especially when
  26. "not really necessary".
  27. Although I appreciate all replies explaining the pitfalls of co-expressions
  28. (maybe someone could also explain the INFIX @-operator, I always wondered
  29. about that one too), I'm still puzzled by the implementation of reversible
  30. assignment.
  31. #------------------------------------------------------------------------------
  32. procedure revass(a,b)         # pardon the expression
  33. local c
  34. c:=a
  35. suspend ((a:=b)  |  ((a:=c) & (&fail)))
  36. end                                          ######
  37. #------------------------------------------------------------------------------
  38. procedure myrevass(a,b)
  39. local c
  40. c:=a
  41. suspend ((a:=b)  |  ((a:=c)  ))      # &(&fail)))
  42. end                                                   #######
  43. #------------------------------------------------------------------------------
  44.  
  45. Which considerations (if any  ;-)  led to picking the first
  46. implementation ?
  47.  
  48. Thanks again.
  49.  
  50.